<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>添加水文信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/bootstrap-3.3.5-dist/css/bootstrap.css" />

</head>
<body>
	<div class="row-fluid" style="margin-top: 10px;">
		<div class="col-md-6">
			<h3>修改水文信息</h3>
			<form role="form" class="form-horizontal"
				action="${pageContext.request.contextPath}/reporter4/updateHydroStatAction"
				method="post" id="checkForm">
				<div class="form-group">
					<label class="col-md-3 control-label" for="power">水文站名称</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.name"value="${bean.name }" type="text" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="power">站址</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.address"value="${ bean.address}" type="text" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label">更新时间</label>
					<div class="col-md-9">
						<input type="date" name="hstatBean.refreshTime" value="${bean.refreshTime }"class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="dept">水位(米)</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.waterLevel" value="${bean.waterLevel }"type="text" 
						onkeypress="keyPress(this)" onkeyup="keyUp(this)" onblur="onBlur(this)" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="num">水流量(米^3/秒)</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.waterFlow"value="${bean.waterFlow }" type="text"  
						onkeypress="keyPress(this)" onkeyup="keyUp(this)" onblur="onBlur(this)" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="unit">警戒水位(米)</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.warningWaterLevel" value="${bean.warningWaterLevel }"type="text"
						onkeypress="keyPress(this)" onkeyup="keyUp(this)" onblur="onBlur(this)"  />
					</div>
				</div>
				<div class="form-group">
					<label class="col-md-3 control-label" for="name">备注</label>
					<div class="col-md-9">
						<input class="form-control" name="hstatBean.notes" value="${bean.notes }" type="text" />
					</div>
				</div>
				
				<div class="form-group">
					<input name="hstatBean.userBean.id" value="${bean.userBean.id }" type="hidden" />
					<input name="hstatBean.id" value="${ bean.id}"  type="hidden" />
				</div>
				<div class="form-group">
					<div class="col-md-offset-3 col-md-9">
						<button type="submit" class="btn btn-primary btn-block">
							提交</button>
					</div>
				</div>
			</form>
		</div>
		<div class="col-md-3"></div>
	</div>
	<script
		src="${pageContext.request.contextPath}/static/js/jquery-1.12.1.js"
		type="text/javascript"></script>
	<script
		src="${pageContext.request.contextPath}/static/bootstrap-3.3.5-dist/js/bootstrap.js"
		type="text/javascript"></script>
	<script
		src="${pageContext.request.contextPath}/static/js/jquery.validate.js"
		type="text/javascript"></script>
	<script
		src="${pageContext.request.contextPath}/static/js/myValidate.js"
		type="text/javascript"></script>
	<script type="text/javascript">
		function keyPress(ob) {
			if (!ob.value.match(/^[\+\-]?\d*?\.?\d*?$/))
				ob.value = ob.t_value;
			else
				ob.t_value = ob.value;
			if (ob.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))
				ob.o_value = ob.value;
		}
		function keyUp(ob) {
			if (!ob.value.match(/^[\+\-]?\d*?\.?\d*?$/))
				ob.value = ob.t_value;
			else
				ob.t_value = ob.value;
			if (ob.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))
				ob.o_value = ob.value;
		}
		function onBlur(ob) {
			if (!ob.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))
				ob.value = ob.o_value;
			else {
				if (ob.value.match(/^\.\d+$/))
					ob.value = 0 + ob.value;
				if (ob.value.match(/^\.$/))
					ob.value = 0;
				ob.o_value = ob.value
			}
			;
		}
	</script>
</body>
</html>